package com.gagakuai.bpm.dao.mapper.camunda;


import com.baomidou.mybatisplus.core.metadata.IPage;



import com.gagakuai.bpm.domian.entity.camuda.ActHiActinst;
import com.gagakuai.bpm.domian.entity.camuda.WorkFlowTaskNode;
import com.gagakuai.bpm.domian.query.camunda.WorkflowQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WorkFlowTaskNodeMapper {
    int deleteByPrimaryKey(String id);

    int insert(WorkFlowTaskNode record);

    int insertOrUpdate(WorkFlowTaskNode record);

    int insertOrUpdateSelective(WorkFlowTaskNode record);

    int insertSelective(WorkFlowTaskNode record);

    WorkFlowTaskNode selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(WorkFlowTaskNode record);

    int updateByPrimaryKey(WorkFlowTaskNode record);

    int updateBatch(List<WorkFlowTaskNode> list);

    int batchInsert(@Param("list") List<WorkFlowTaskNode> list);


    /*
     * @param processId 流程Id
     * @Author houhong
     * @Description //TODO 根据流程Id 获取流程办理轨迹
     * @Date 3:25 下午 2022/3/22
     */
    IPage<ActHiActinst> selectWorkflowNoByProcessIdPage(IPage<ActHiActinst>  page,
                                                        @Param("queryDto") WorkflowQuery queryDto,
                                                        @Param("processId") String processId) throws Exception;


    int updateAssigneByTaskId(@Param("assignee")String assignee,@Param("taskId")String taskId);


    int selectRuTaskNum(@Param("prcoessId")String processId,@Param("taskId")String taskId,@Param("userId")String userId);



    String selectTaskIdByProcess(@Param("prcoessId")String processId);

    String selectTaskIdByUserAndProcessIn(@Param("processId")String processId, @Param("userId")String userId);

    IPage<ActHiActinst> selectWorkflowNoByProcessOorderByEndIdPage(IPage<ActHiActinst>  page,
                                                                   @Param("queryDto") WorkflowQuery queryDto,
                                                                   @Param("processId") String processId) throws Exception;


    ActHiActinst selectEndNodeByProcess( @Param("processId") String processId);
}